|
HSL 2.0 framework
Description of the framework
|
All methods for communication via UDP broadcast. More..
.Inherits hsl20_4_udp.hsl20_4_udp.UdpBase
Public Member Functions | |
| def | set_address (self, ip, port) |
| Sets the server address for the broadcast where data can be received. More... | |
| def | send_to (self, data, ip, port) |
| Sends data by broadcast to the specified address. More... | |
Public Member Functions inherited from hsl20_4_udp.hsl20_4_udp.UdpBase | |
| def | __init__ (self, framework, context_map) |
| Constructor. More... | |
| def | set_on_data (self, callback) |
| Sets a callback for data reception. More... | |
| def | set_on_error (self, callback) |
| Sets a callback in case of an error. More... | |
| def | start_server (self) |
| Starts the UDP receive server. More... | |
All methods for communication via UDP broadcast
Provides communication via UDP/IP in both directions.
Is derived from UdpBase.
Example
The example includes a Broadcast UDP client. If a telegram arrives at input 1 (PIN_I_DATA), it is sent via UDP. Via inputs 2 (PIN_I_IP) and 3 (PIN_I_PORT) the broadcast IP and port are determined.
| def hsl20_4_udp.hsl20_4_udp.Broadcast.send_to | ( | self, | |
| data, | |||
| ip, | |||
| port | |||
| ) |
| def hsl20_4_udp.hsl20_4_udp.Broadcast.set_address | ( | self, | |
| ip, | |||
| port | |||
| ) |
Sets the server address for the broadcast where data can be received
| ip | string IP address. If an empty string is specified, the data is received at the HomeServer network address |
| port | int IP port where the data can be received and sent |
| RuntimeError | If this method is called while the server is already started, a RuntimeError exception is thrown |
1.8.13